/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package webservicespike;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

/**
 *
 * @author Renato Rosa
 */
@WebService(name = "Hello", serviceName = "HelloService", portName = "HelloPort")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class Hello {
    private WebServiceSpike mainInterface;

    public Hello(WebServiceSpike mainInterface) {
        this.mainInterface = mainInterface;
    }
    
    @WebMethod(operationName = "simpleHello")
    public String sayHello(){
        mainInterface.presentInfo("simpleHello invoked.");
        return "Hello!";
    }
    
    @WebMethod(operationName = "namedHello")
    public String sayNamedHello(@WebParam(name = "name") String name){
        mainInterface.presentInfo("namedHello invoked.");
        return "Hello " + name + "!";
    }
    
}
